# 基础镜像
FROM alpine

# 镜像维护者
MAINTAINER alpine-python-apk Docker image "enovo458@126.com" author "drophair"

# alpine更换 阿里 镜像源
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories && \
    echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories

# 配置httpd
RUN apk update && \
    apk add --no-cache gcc make lsof vim cmake apr openssl-dev pcre-dev expat-dev libtool g++ wget curl && \
    cd /usr && \
    mkdir src && \
    wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz && \
    wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz && \
    wget https://mirrors.bfsu.edu.cn/apache/httpd/httpd-2.4.46.tar.gz && \
    tar -zvxf apr-1.5.2.tar.gz && \
    cd apr-1.5.2 && \
    ./configure --prefix=/usr/local/apr/ && \
    make && make install && \
    cd .. && \
    tar -zvxf apr-util-1.5.4.tar.gz && \
    cd apr-util-1.5.4 && \
    ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr && \
    make && make install && \
    cd .. && \
    tar -zvxf httpd-2.4.46.tar.gz && \
    cd httpd-2.4.46 && \
    ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-include-apr && \
    make && make install && \
    ln -sv /etc/httpd24/ /etc/httpd && \
    source /etc/profile.d/httpd.sh && \
    httpd -v && \
    echo "MANPATH /usr/local/apache/man" >> /etc/man.config && \
    apachectl start




